<?php
// 网站主页
class IndexAction extends Action{
	public function index(){
		header("Content-Type:text/html; charset=utf-8");
		$this->display();
	}
	/**
	 +----------------------------------------------------------
	 * 药品添加
	 +----------------------------------------------------------
	 */
	public function ypadd(){
		header("Content-Type:text/html; charset=utf-8");
		$this->display();
	}
	/**
	 +----------------------------------------------------------
	 * 药品添加提交
	 +----------------------------------------------------------
	 */
	public function ypsubmmit(){
		$yp=D("Leechdom");
		if($yp->create()){
			$yp->add();
			$yp->redirect();
			header("Content-Type:text/html; charset=utf-8");
			exit(' [ <A HREF="javascript:history.back()">返 回</A> ]');
		}else{
			header("Content-Type:text/html; charset=utf-8");
			exit($yp->getError().' [ <A HREF="javascript:history.back()">返 回</A> ]');
		}
	}
	/**
	 +----------------------------------------------------------
	 * 病例添加提交
	 +----------------------------------------------------------
	 */
	public function blsubmmit(){
		$bl=D("Treatment");
		if($bl->create()){
			$bl->add();
			$bl->redirect();
			header("Content-Type:text/html; charset=utf-8");
			exit(' [ <A HREF="javascript:history.back()">返 回</A> ]');
		}else{
			header("Content-Type:text/html; charset=utf-8");
			exit($bl->getError().' [ <A HREF="javascript:history.back()">返 回</A> ]');
		}
	}
	/**
	 +----------------------------------------------------------
	 * 上传图片
	 +----------------------------------------------------------
	 */
	public function upload(){
		$state=uploadfile('upload');
		echo json_encode($state);
	}
}
?>